<?php
/**
 * @author Jumper Swordwave
 * date: 2021/04/20
 */
use Hyperf\Server\ServerFactory;
use Hyperf\Utils\ApplicationContext;
use Hyperf\Redis\Redis;

if (! function_exists('container')) {
    function container()
    {
        return ApplicationContext::getContainer();
    }
}

if (! function_exists('server')) {
    function server()
    {
        return container()->get(ServerFactory::class)->getServer()->getServer();
    }
}

if (! function_exists('redis')) {
    function redis()
    {
        return container()->get(Redis::class);
    }
}